﻿using System.Drawing;

namespace FotoAlbum.Async
{
    abstract class LoaderEvents
    {
        /// <summary>
        /// The single image loaded delegate.
        /// </summary>
        /// <param name="e">The event arguments.</param>
        public delegate void SingleImageLoadedEventHandler(LoaderEventArgs e);

        /// <summary>
        /// The actual single image loaded event.
        /// </summary>
        public event SingleImageLoadedEventHandler SingleImageLoadedEvent;

        /// <summary>
        /// Raise an event for the just loaded image.
        /// </summary>
        /// <param name="loadObj">The load object of the image.</param>
        protected virtual void RaiseSingleImageLoadedEvent(LoaderEventArgs loadObj)
        {
            if (SingleImageLoadedEvent != null)
            {
                SingleImageLoadedEvent(loadObj);
            }
        }

        public delegate void LoadingCompletedEventHandler();
        public event LoadingCompletedEventHandler LoadingCompleted;
        protected virtual void RaiseLoadingCompletedEvent()
        {
            if (LoadingCompleted != null)
            {
                LoadingCompleted();
            }
        }
    }
}
